﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace PoshBoard.VisualDesigner.Controls
{
    public class NewTextBlock : TextBlock, IPBComponentBase
    {
        public NewTextBlock()
        {
            this.Text = "New-TextBlock";
        }

        public string CommandBase { get { return "New-TextBlock"; } }

        public string PSName { get; set; }

        public void BuildPSName(string parentName)
        {
            this.PSName = "$" + parentName + "_" + this.Name;
        }

        public string GetParameters()
        {
            string param = PSScriptHelper.GetCommonParameters(this);

            param += " -Text '" + this.Text.ToString() + "'";

            param += " -FontSize '" + this.FontSize.ToString() + "'";

            param += " -FontWeight '" + this.FontWeight.ToString() + "'";

            param += " -TextAlignment '" + this.TextAlignment.ToString() + "'";

            //if (this.Foreground != null)
            //{
            //    param += " -Foreground " + ColorHelper.GetBrushesNameByString(this.Foreground.ToString());
            //}
            //if (this.Background != null)
            //    param += " -Background " + ColorHelper.GetBrushesNameByString(this.Background.ToString());


            return param;
        }

        public string GetConstructionScript()
        {
            return PSScriptHelper.BuildPSScript(this, this.Name, null);
        }
    }
}
